#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,max,point,boss,temp,ans;
	double g1;
	vector<int> list;
	cin >> n >> max;
	for(int i = 0;i < n;i++){
		cin >> boss;
		list.clear();
		for(int j = 0;j < n-1;j++){
			cin >> temp;
			if(temp>=0 && temp<=max) list.push_back(temp);
		}
		sort(list.begin(),list.end());
		g1 = 0;
		for(vector<int>::iterator k = list.begin()+1;k < list.end()-1;k++){
			g1 += *k;
		}
		g1 = g1/(list.end()-list.begin()-2);
		ans = (g1+boss)/2+0.5;
		cout << ans << endl;
	}
	 
	return 0;
}

